﻿@model IEnumerable<Common.Product>
@if (Model.Count() > 0)
{
<table>
    <tr>
        <th>Product Name</th>
        <th>Features</th>
        <th>Image</th>
        <th>Quantity</th>
        <th>Price</th>
        <th>Date Listed</th>
    </tr>

@foreach (var item in Model)
{
    <tr>
        <td>@Html.DisplayFor(modelItem => item.ProductName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Features)
        </td>
        <td>
            <img height="150px" width="150px" src= "@Url.Content(item.ImageLink)" alt="@Html.DisplayFor(modelItem => item.ImageLink)" />
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.StockQty)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.DateListed)
        </td>
    </tr>
}
</table>
}
else
{
    <br /> <div style="color:Red">@Html.Label("No products with that name were found")</div>
}